/*
 This file 'wxhxp_1' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-06-14 20:49
 */

define(function (require, exports, module) {

	require("../model/Chart");

	echarts.registerMap('china', require("../assets/map/json/china.json"))

	var ArrayUtils = require("../assets/ArrayUtils");

	var id = "wxhxp_1_chart_1";

	Firebird.define(id, {
		extend: "Chart",
		setValue: function (data) {

			this.data = data = [
				{
					value: 10,
					name: "重点监管",
				}, {
					value: 20,
					name: "易制毒"
				}, {
					value: 30,
					name: "易制爆"
				}, {
					value: 40,
					name: "高毒物"
				}, {
					value: 50,
					name: "剧毒"
				}
			]

			var option = {

				color: [
					Chart.linearGradient('rgba(201, 144, 74, 1)', 'rgba(226, 195, 146, 1)'),
					Chart.linearGradient("rgba(108, 42, 208, 1)", "rgba(128, 68, 229, 1)"),
					Chart.linearGradient("rgba(207, 122, 18, 1)", "rgba(229, 167, 71, 1)"),
					Chart.linearGradient("rgba(59, 81, 255, 1)", "rgba(88, 138, 255, 1)"),
					Chart.linearGradient("rgba(135, 53, 59, 1)", "rgba(191, 127, 134, 1)")
				],


				grid: {
					bottom: 0,
					left: 0,
					right: 0
				},
				series: [
					// 数据圈
					{
						radius: [70, 100],
						center: ['50%', '50%'],
						type: 'pie',
						label: {
							width: 80,
							rich: {},
							normal: {
								show: true,
								formatter: "{b}\n{c}",
								color: "rgba(255, 255, 255, 1)",
								textStyle: {
									fontSize: 12,
								}, // position: 'outside'
							},
							emphasis: {
								show: true
							}
						},
						labelLine: {
							normal: {
								show: true, // length: 30,
								// length2: 55
							},
							emphasis: {
								show: true
							}
						},
						data: data.map(function (node, index) {
							return node;
						})

					},


				]

			};


			this.clear();
			this.setOption(option, !0);
		},
	});

	module.exports = Firebird.create(id, {id: id});
});